<!--
 * @Description  : 
 * @Version      : 1.0
 * @Author       : Shiming
 * @Date         : 2022-04-06 13:20:56
 * @LastEditors  : Shiming
 * @LastEditTime : 2022-04-29 17:55:02
 * @FilePath     : \\tms-obc-web\\src\\app\\routes\\datatable\\components\\customtable\\customindex\\customindex.component.html
 * Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<!-- 页头 -->
<page-header-wrapper [title]="'客户报表'"></page-header-wrapper>
<div nz-row [nzGutter]="16" acl [acl-ability]="['customindex-statisticsTotal']">
  <div nz-col class="gutter-row" [nzSpan]="6">
    <g2-card [title]="'货主'" [bordered]="true" [total]="hzData?.total || '0'"
      [footer]="'已认证' + ' ' + hzData?.auditPassTotal" contentHeight="46">
    </g2-card>
  </div>
  <div nz-col class="gutter-row" [nzSpan]="6">
    <g2-card [title]="'合伙人'" [bordered]="true" [total]="hhrData?.total || '0'"
      [footer]="'已认证' + ' ' + hhrData?.auditPassTotal" contentHeight="46">
    </g2-card>
  </div>
  <div nz-col class="gutter-row" [nzSpan]="6">
    <g2-card [title]="'司机'" [bordered]="true" [total]="sjData?.total || '0'"
      [footer]="'已认证' + ' ' + sjData?.auditPassTotal" contentHeight="46">
    </g2-card>
  </div>
  <div nz-col class="gutter-row" [nzSpan]="6">
    <g2-card [title]="'车辆'" [bordered]="true" [total]="clData?.total || '0'"
      [footer]="'已认证'  + ' '+ clData?.auditPassTotal" contentHeight="46">
    </g2-card>
  </div>
</div>
<nz-card nzTitle="客户报表" [nzExtra]="extraTemplate" acl [acl-ability]="['customindex-client']">
  <ng-template #extraTemplate>
    <div class="chooseBox">
      <div class="timeBox">
        <nz-radio-group [(ngModel)]="mode" nzButtonStyle="solid" (ngModelChange)="changeData()">
          <label nz-radio-button nzValue="year">年</label>
          <label nz-radio-button nzValue="month">月</label>
          <label nz-radio-button nzValue="date">日</label>
          <label nz-radio-button nzValue="define">自定义</label>
        </nz-radio-group>
        <div class="dateBox">
          <nz-date-picker [(ngModel)]="date" [nzMode]="mode" [nzFormat]="dateFormat" *ngIf="mode !== 'define'"
            [nzDisabledDate]="disabledDate" (ngModelChange)="onChange($event)"></nz-date-picker>
          <nz-range-picker [(ngModel)]="defineDate" [nzFormat]="dateFormat" *ngIf="mode === 'define'"
            [nzDisabledDate]="disabledDate" (ngModelChange)="onChange($event)"></nz-range-picker>
        </div>
      </div>
    </div>
  </ng-template>
  <st #st multiSort [columns]="columns" [ps]="20" [data]="reportData" [scroll]="{ x: '1200px' }"
    [res]="{ reName: { list: 'data', total: 'data.total' } }"
    [page]="{ show: false, showSize: false, pageSizes: [20, 50, 100] }">
    <ng-template st-row="type" let-item>
      <div *ngIf="item.type == '1'">货主</div>
      <div *ngIf="item.type == '2'">合伙人</div>
      <div *ngIf="item.type == '3'">司机</div>
      <div *ngIf="item.type == '4'">车辆</div>
    </ng-template>
  </st>
</nz-card>
<nz-card nzTitle="用户新增报表" [nzExtra]="extraTemplate01" acl [acl-ability]="['customindex-totalAdd']">
  <ng-template #extraTemplate01>
    <div class="chooseBox">
      <div class="timeBox">
        <nz-radio-group [(ngModel)]="modeNext" nzButtonStyle="solid" (ngModelChange)="changeDataNext2()">
          <label nz-radio-button nzValue="year">年</label>
          <label nz-radio-button nzValue="month">月</label>
        </nz-radio-group>
        <div class="dateBox">
          <nz-date-picker [nzDisabledDate]="disabledDate" [(ngModel)]="dateNext" [nzMode]="modeNext"
            (ngModelChange)="onChangeNext($event)"></nz-date-picker>
        </div>
      </div>
    </div>
  </ng-template>
  <app-datatable-customindex-curve #curve [chartData]="chartData"></app-datatable-customindex-curve>
</nz-card>